import requests
import json
url='https://passport.cnblogs.com/user/signin'
headersCode=\
    {
        'Connection':'keep-alive',
        'Content-Length':'386',
        'Accept':'application/json, text/javascript, */*; q=0.01',
        'Origin':'https://passport.cnblogs.com',
        'X-Requested-With':'XMLHttpRequest',
        'VerificationToken':'kkyfwz-jxbJ9Nto6zpYjeibjF8sCi_rj_lwESvypS1C_sBdMszU89lGaISQvzheVLdWYt2HqvR5Wb4gR2MwxTfD'
                            'Bu7g1:cMd5sKtn6w9GWIyxO-XQco4JBrq458u97xXoUTxiow61B2brw_uGz6t18LqxhyxJ4u5-ccQj5VWyVDm-f'
                            'Z9Xb5A_W641',
        'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 '
                                                       '(KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36',
        'Content-Type':'application/json; charset=UTF-8',
        'Referer':'https://passport.cnblogs.com/user/signin?ReturnUrl=https%3A%2F%2Fwww.cnblogs.com%2F',
        'Accept-Encoding':'gzip, deflate, br',
        'Accept-Language':'zh-CN,zh;q=0.8',
        'Cookie':'UM_distinctid=15d7ec414a81e9-0994a9c1917edb-333f5902-1fa400-15d7ec414a9b8; '
                 '__gads=ID=27ede95666c77325:T=1503996976:S=ALNI_MbTXVuj-9z4HJhUT1_KlONP8vXv9A; _ga=GA1.2.211816624.'
                 '1501042106; _gid=GA1.2.166286666.1503970842; _gat=1; SERVERID=dcc5cb8c464da84cc9928c22dd5884f8|1503'
                 '998547|1503992518',}
namePassWord= \
    {"input1": "ohS6ty83iqwD006fHJXa2tqjB80wSFFIAQunY4KlhDtzoQo+CB96vUp/MyFP7JiMEFisA/AGjIU1htJGzbeaKI6dq7JK2585CZVgANf"
               "tspn9mVdr2rnJtN+C579/t6sP7wl58mm8E/MoXBqojeQ+7HaoPDTvghiKBFySLjxf1Nc=",
     "input2": "eQrXUhWiw4NgEUq3aazXXLfUZiqHx2Xka7s+r9Dt1ZFlEbUqMF9tG0OwXRIrh+/ecqGdOPN2wOhO/ZnOGAhqeMuFi8PaG3/b2Kv9KLZ"
               "//b/R8VdTdTUO+w7n6VKqkeznYyED10452mBJLQNpXgA6aPfpGXbW2jkdRIB1ruBWlwo=","remember": False
     }
s=requests.session()
response=s.post(url,headers=headersCode,json=namePassWord,verify=False)
print(response.json())
print(response.status_code,response.content)

url01='https://i.cnblogs.com/EditPosts.aspx?opt=1'
namePassWord01={
    '__VIEWSTATE':'',
    '__VIEWSTATEGENERATOR':'FE27D343',
    'Editor$Edit$txbTitle':'新增随笔04',
    'Editor$Edit$EditorBody':'<p>这是接口输入04</p>',
    'Editor$Edit$Advanced$ckbPublished':'on',
    'Editor$Edit$Advanced$chkDisplayHomePage':'on',
    'Editor$Edit$Advanced$chkComments':'on',
    'Editor$Edit$Advanced$chkMainSyndication':'on',
    'Editor$Edit$lkbPost':'发布',
}  #请求数据
headersCode01={
'Connection': 'keep-alive',
'Content-Length': '9275',
'Cache-Control': 'max-age=0',
'Origin': 'https://i.cnblogs.com',
'Upgrade-Insecure-Requests': '1',
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36',
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
'Referer': 'https://i.cnblogs.com/EditPosts.aspx?opt=1',
'Accept-Encoding': 'gzip, deflate, br',
'Accept-Language': 'zh-CN,zh;q=0.8',
'Cookie': 'UM_distinctid=15d7ec414a81e9-0994a9c1917edb-333f5902-1fa400-15d7ec414a9b8; __gads=ID=27ede95666c77325:T='
          '1503996976:S=ALNI_MbTXVuj-9z4HJhUT1_KlONP8vXv9A; .CNBlogsCookie=B852D08188A4FFB9C84F5BB6E22C2A6B6E8D7508B70A600C9EFC14F296F8CC895A3A7779D5EC9A9C9E8400E383BCA5896EA8CA0CB1679E708'
          'A751EBF56234352458CEEC88AF79B1E52A15252219E2D47D5C7AB681B01474048DF44E72E87DC0717B84605; .Cnblogs.AspNetCore.Cookies=CfDJ8PhlBN8IFxtHhqIV3s0LCDlCTVhRcEVm7k7WbTsegtQaT_vIXFi0ZZeVCRa4zckrDhPviJBQh34_ZdCKqJF-FcVsWUcICuApB21nOuJIH4iyL2YQrUqTR9qG2nP5_lUP4tpZbWfh39BDuZNvot8xVZMKsJY70ABRa7TRVwRHsGrspXGfpE4BbjoV-FILLrstRa13PrW'
          'c5_iMJFcvlatJq9yWiejQi-8FU_7tZAkzjSIlwWoD39wmSIG8uu86RvWVFeaWiASJL_ox_rZsgPFzfiltDO4zn4tILkSL9KVRy-Gy; _ga='
          'GA1.2.211816624.1501042106; _gid=GA1.2.166286666.1503970842; SERVERID=5600344ccf6bd2d4bb4775a2baf862da|1503'
          '999233|1503997016',
}   #脑壳

response02=s.post(url01,headers=headersCode01,data=namePassWord01,verify=False,)
print(response02.text)